﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IRC.IRepairClouds.DataLayer.Cache;

namespace IRC.IRepairClouds.WebClient.Controls.Common
{
    public partial class LoggedUser : System.Web.UI.UserControl
    {
        public LoggedUser()
        {
            this.Load += new EventHandler(_Load);
        }

        void _Load(object sender, EventArgs e)
        {
            LoadData();
        }

        private void LoadData()
        {
            var ud = CacheManager.Users.Current;
            if (ud != null)
                LabelName.Text = ud.Login;
            else
                LabelName.Text = null;
        }
    }
}